<template>
  <div>
   <van-tree-select height="55vw" :items="items" :main-active-index.sync="active">
  <template #content>
     <div class="right" v-for="(item,index) in items" :key="item.id">
       <van-grid :border="false" :column-num="3" v-if="active==index">
  <van-grid-item v-for="(int) in items[active].children" :key="int.id">
   
    <van-image :src="int.img" />
     <span>{{int.name}}</span>
  </van-grid-item>
  
</van-grid>
    
     </div>
    
  </template>
</van-tree-select>

  </div>
</template>

<script>
import request from "@/utils/request"
export default {
  name:"Classify",
  data() {
    return {
     active: 0,
      items: [{ text: '分组 1' }, { text: '分组 2' }],
    };
  },
  created() {
    request.get("/classlist").then(res=>{
      this.items=res.data
    })
  },
}
</script>

<style>
.van-tree-select__nav,.van-tree-select__content{
  height: 620px !important;
}
</style>